package com.shadow.baiqun.delegate.room.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shadow.baiqun.R;
import com.shadow.baiqun.config.ItemField;
import com.shadow.baiqun.delegate.room.check.CheckTaskEntity;
import com.shadow.ui.recycler.MultipleItemEntity;

import java.util.List;

/**
 * @author zy
 *         on 2018/6/19
 */
public class TiltingAdapter extends BaseQuickAdapter<MultipleItemEntity, BaseViewHolder> {
    public TiltingAdapter(int layoutResId, @Nullable List<MultipleItemEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MultipleItemEntity item) {
        CheckTaskEntity checkTaskEntity = item.getField(ItemField.ITEM_OBJ);
        helper.setText(R.id.tv_count, checkTaskEntity.getTotalnum() + "/" + checkTaskEntity.getDone());
        helper.setText(R.id.tv_add_person, checkTaskEntity.getAddName());
        helper.setText(R.id.tv_date, checkTaskEntity.getAddTime());
    }
}
